package com.zhike.controller;

import com.zhike.service.DwsTempWindowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhike
 * @CreateTime: 2024/5/1
 * @Description: 温控主题的controller
 */
@RestController
@RequestMapping("temp")
public class TempTodayController {
    @Autowired
    private DwsTempWindowService dwsTempWindowService;

    /**
     * 获取当日每辆车的电机最高温度和平均温度
     */
    @PostMapping("getTempToday")
    public String getTempToday(@RequestBody String filter){
        return dwsTempWindowService.getTempToday(filter);
    }

    /**
     * 获取当日每辆车的电机控制器最高温度和平均温度
     */
    @PostMapping("getTempConToday")
    public String getTempConToday(@RequestBody String filter){
        return dwsTempWindowService.getTempConToday(filter);
    }

    /**
     * 获取当日每辆车的电池最高温度和温度异常次数
     */
    @PostMapping("getTempCountToday")
    public String getTempCountToday(@RequestBody String filter){
        return dwsTempWindowService.getTempCountToday(filter);
    }
}
